package com.wjy.sfhcore.util;
import com.wjy.sfhcore.CoreApplication;

/**
 * Created by wangjingyuan on 15/7/31.
 * 反射获取资源ID
 */
public class ResourceIDHelp {
    public static int getLayoutId( String paramString) {
        return CoreApplication.getInstance().getResources().getIdentifier(paramString, "layout",
                CoreApplication.getInstance().getPackageName());
    }

    public static int getStringId( String paramString) {
        return CoreApplication.getInstance().getResources().getIdentifier(paramString, "string",
                CoreApplication.getInstance().getPackageName());
    }

    public static int getDrawableId( String paramString) {
        return CoreApplication.getInstance().getResources().getIdentifier(paramString,
                "drawable", CoreApplication.getInstance().getPackageName());
    }

    public static int getStyleId( String paramString) {
        return CoreApplication.getInstance().getResources().getIdentifier(paramString,
                "style", CoreApplication.getInstance().getPackageName());
    }

    public static int getId( String paramString) {
        return CoreApplication.getInstance().getResources().getIdentifier(paramString, "id", CoreApplication.getInstance().getPackageName());
    }

    public static int getColorId( String paramString) {
        return CoreApplication.getInstance().getResources().getIdentifier(paramString,
                "color", CoreApplication.getInstance().getPackageName());
    }

    public static int getArrayId( String paramString) {
        return CoreApplication.getInstance().getResources().getIdentifier(paramString,
                "array", CoreApplication.getInstance().getPackageName());
    }
}
